﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using NHibernate;
using System.ComponentModel;

namespace Apollo
{
    public partial class Application : HttpApplication
    {
        public IList<AsyncProcess> AsyncProcesses { get; private set; }


        public void RunAsyncProcess(string code, string name, BackgroundWorker worker) {
            this.RunAsyncProcess(code, name, worker, null, false);
        }
        public void RunAsyncProcess(string code, string name, BackgroundWorker worker, object workerArg, bool reportToAllUsers) {
            AsyncProcess async = new AsyncProcess(code, name, worker, workerArg, reportToAllUsers ? null : CurrentUser);

            this.AsyncProcesses.Add(async);
        }
    }
}
